<?php
	class DealUtil{
	public  function deal(&$type,&$data){
		$postObj = simplexml_load_string($data, 'SimpleXMLElement', LIBXML_NOCDATA);
		    $fromUsername = $postObj->FromUserName;

		    $toUsername = $postObj->ToUserName;

			$textTpl = "<xml>

									<ToUserName><![CDATA[%s]]></ToUserName>

									<FromUserName><![CDATA[%s]]></FromUserName>

									<CreateTime>%s</CreateTime>

									<MsgType><![CDATA[text]]></MsgType>

									<Content><![CDATA[%s]]></Content>

									<FuncFlag>0</FuncFlag>

									</xml>";  

			 $time = time();

		     $contentStr = "握手贸易测试数据22233"."[".$type."]"."[".$this->callbacks[self::TYPE_PINGANBAODIAN]."]";

		

		     $resultStr = sprintf($textTpl, $fromUsername, $toUsername,$time,$contentStr);

		

		     echo $resultStr; 
	
		}
	}

?>